package api

import (
	"github.com/spf13/cobra"
	_var "ssadmin/common/vars"
	"ssadmin/internal/admin"
)

var StartCmd = &cobra.Command{
	Use:          "server",
	Short:        "Start API server",
	Example:      "ssadmin server -c config/settings.yml",
	SilenceUsage: true,
	RunE: func(cmd *cobra.Command, args []string) error {
		return admin.Start()
	},
}

func init() {
	StartCmd.PersistentFlags().StringVarP(&_var.ConfigFile, "config", "c", "config/settings.yml", "Start server with provided configuration file")
}
